package com.zhdl.modules.tools;

import com.zhdl.modules.autopick.entity.Cassette;
import com.zhdl.modules.autopick.entity.CassettePosition;
import com.zhdl.modules.autopick.entity.Sensor;

import java.util.ArrayList;
import java.util.List;

public class InitCassette {

    public static List<Cassette> cassetteInit() {
        List<Cassette> cassetteList = new ArrayList<>();
        Cassette cassette1 = new Cassette();
        Cassette cassette2 = new Cassette();
        Cassette cassette3 = new Cassette();
        Cassette cassette4 = new Cassette();

        CassettePosition cassettePosition1 = new CassettePosition();
        CassettePosition cassettePosition2 = new CassettePosition();
        CassettePosition cassettePosition3 = new CassettePosition();
        CassettePosition cassettePosition4 = new CassettePosition();

        List<Sensor> sensorList0 = new ArrayList<>();
        cassette1.setId(0);
        sensorList0.add(new Sensor(8, "0", "料斗1报警"));
        sensorList0.add(new Sensor(6, "1", "料斗1开到位"));
        sensorList0.add(new Sensor(7, "2", "料斗1关到位"));
        sensorList0.add(new Sensor(2, "3", "料斗1推杆伸出"));

        cassettePosition1.setCasRunOpenLid(334375);
        cassettePosition1.setCasOpenLid(481250);
        cassettePosition1.setCasRunCloseLid(31250);
        cassettePosition1.setCasCloseLid(-343750);
        cassettePosition1.setCasBackHome(-503125);

        cassette1.setSensorList(sensorList0);
        cassette1.setCassettePosition(cassettePosition1);

        List<Sensor> sensorList1 = new ArrayList<>();
        cassette2.setId(1);
        sensorList1.add(new Sensor(14, "0", "料斗2报警"));
        sensorList1.add(new Sensor(12, "1", "料斗2开到位"));
        sensorList1.add(new Sensor(13, "2", "料斗2关到位"));
        sensorList1.add(new Sensor(3, "3", "料斗2推杆伸出"));

        cassettePosition2.setCasRunOpenLid(2906250);
        cassettePosition2.setCasOpenLid(500000);
        cassettePosition2.setCasRunCloseLid(31250);
        cassettePosition2.setCasCloseLid(-346875);
        cassettePosition2.setCasBackHome(-3090625);

        cassette2.setSensorList(sensorList1);
        cassette2.setCassettePosition(cassettePosition2);

        List<Sensor> sensorList2 = new ArrayList<>();
        cassette3.setId(2);
        sensorList2.add(new Sensor(20, "0", "料斗3报警"));
        sensorList2.add(new Sensor(18, "1", "料斗3开到位"));
        sensorList2.add(new Sensor(19, "2", "料斗3关到位"));
        sensorList2.add(new Sensor(4, "3", "料斗3推杆伸出"));

        cassettePosition3.setCasRunOpenLid(5471875);
        cassettePosition3.setCasOpenLid(456250);
        cassettePosition3.setCasRunCloseLid(31250);
        cassettePosition3.setCasCloseLid(-309375);
        cassettePosition3.setCasBackHome(-5650000);

        cassette3.setSensorList(sensorList2);
        cassette3.setCassettePosition(cassettePosition3);

        List<Sensor> sensorList3 = new ArrayList<>();
        cassette4.setId(3);
        sensorList3.add(new Sensor(26, "0", "料斗4报警"));
        sensorList3.add(new Sensor(24, "1", "料斗4开到位"));
        sensorList3.add(new Sensor(25, "2", "料斗4关到位"));
        sensorList3.add(new Sensor(5, "3", "料斗4推杆伸出"));

        cassettePosition4.setCasRunOpenLid(8031250);
        cassettePosition4.setCasOpenLid(456250);
        cassettePosition4.setCasRunCloseLid(25000);
        cassettePosition4.setCasCloseLid(-309375);
        cassettePosition4.setCasBackHome(-8203125);

        cassette4.setSensorList(sensorList3);
        cassette4.setCassettePosition(cassettePosition4);

        cassetteList.add(cassette1);
        cassetteList.add(cassette2);
        cassetteList.add(cassette3);
        cassetteList.add(cassette4);

        return cassetteList;

    }
}
